package com.bdqn.factory;
import com.bdqn.dao.NewsTwoDao;
import com.bdqn.proxy.*;
/**
 * 第三章实战1，2
 */
public class NesTwoDao {
        public static NewsTwoDao getAlgorithm(String key) {
            switch (key) {
                case "+":
                    return new Addition();
                case "-":
                    return new Subtraction();
                case "*":
                    return new Multiplication();
                case "/":
                    return new Division();
                case "%":
                    return new Delivery();
                default:
                    throw new RuntimeException("无效运算符");
            }
        }
}
